package jacker.bit.price;

import org.json.JSONObject;

import android.content.Context;

public class PlatformCnbtc implements Platform {

	@Override
	public String getCode() {
		return "cnbtc";
	}

	@Override
	public String getName(Context ctx) {
		return ctx.getString(R.string.platform_cnbtc);
	}

	@Override
	public float getPrice() throws Exception{
		String result = PriceChecker.httpGet("http://api.chbtc.com/data/ticker");
		JSONObject json = new JSONObject(result);
		return Float.parseFloat(json.getJSONObject("ticker").getString("last"));
	}

	@Override
	public String getCurrency() {
		// TODO Auto-generated method stub
		return "¥";
	}
	
	

}
